﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        EventCenter.GetInstance().AddEventListener<Monster>("MonsterDead", PlayerWaitMonsterDeadDo);
        
    }

    
    public void PlayerWaitMonsterDeadDo(Monster info)
    {
        //判断传入的怪物的参数，进行不同的行为
        if (info.name == "123456")
        {
            Debug.Log("123456怪物死亡了，Player做的事");
        }
        else
            Debug.Log("其他怪物死亡了，Player做的事");
    }

    private void OnDestroy()
    {
        EventCenter.GetInstance().RemoveEventListener<Monster>("MonsterDead", PlayerWaitMonsterDeadDo);
    }
}
